package lesson14.thrift;

import com.alibaba.fastjson.JSON;
import lesson14.thrift.*;
import org.apache.thrift.TException;

/**
 * 实现类<br/>
 * Created on : 2018-06-12 19:51
 * @author lizebin
 */
public class PersonServiceImpl implements PersonService.Iface {

    @Override
    public Person getByName(String name) throws DataException, TException {
        Person person = new Person();
        person.setAge(27);
        person.setName(name);
        person.setMarried(false);
        System.out.println(JSON.toJSONString(person));
        return person;
    }

    @Override
    public void save(Person person) throws DataException, TException {
        System.out.println("新增:" + JSON.toJSONString(person));
    }
}
